<?php

include_once __DIR__ . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "Config.php";

class Database
{

    protected static $db_handler;

    static function getDBHandler()
    {
        if (!isset(self::$db_handler)) {
            self::$db_handler = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASS);
        }
        return self::$db_handler;
    }

    static function escape($string)
    {
        return mysql_real_escape_string($string);
    }

}
